#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int  checkPerfectNumber(int num) 
{
    int ret = 0;
    for (int i = 1; i < num; i++)
    {
        if (num % i == 0)
            ret += i;
        else if (ret>num)
            break;
    }
    if (ret == num)
        return 1;
    else if(ret>num)
    return 0;
    return 0;
}

int main()
{
    int ret = checkPerfectNumber(2016);
    printf("%d", ret);
	return 0;
}